package flst.ipiweb.service;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import flst.ipiweb.common.PaiementCB;
import flst.ipiweb.common.PaiementPaypal;
import flst.ipiweb.common.TypePaiement;
import flst.ipiweb.dao.DAOFactory;
import flst.ipiweb.exceptions.IPIWebException;

public class ServicePaiement {

	/*public boolean createTypePaiement(TypePaiement typePaiement) throws IPIWebException {

		try {
			return DAOFactory.getPaiementDAO().createTypePaiement(typePaiement);
		} catch (Exception e) {
			return false;
		}

	}*/

	/*public void updateTypePaiement(List<TypePaiement> listModePaiement) throws IPIWebException 
    {
            for(TypePaiement mode : listModePaiement)
            {
                    DAOFactory.getPaiementDAO().updateTypePaiement(mode);
            }
    }*/
	
	public void updateTypePaiement(TypePaiement typePaiement) throws IPIWebException 
    {
                    DAOFactory.getPaiementDAO().updateTypePaiement(typePaiement);
    }
	
	/*public boolean deleteTypePaiement(TypePaiement typePaiement) throws IPIWebException {

		try {
			return DAOFactory.getPaiementDAO().deleteTypePaiement(typePaiement);
		} catch (Exception e) {
			return false;
		}

	}
*/
	public List<TypePaiement> getListTypePaiement() throws IPIWebException {

		try {
			return DAOFactory.getPaiementDAO().getListTypePaiement();
		} catch (Exception e) {
			return new ArrayList<TypePaiement>();
		}

	}
/*
	public boolean createPaiementCB(PaiementCB paiementCB) throws IPIWebException {

		try {
			return DAOFactory.getPaiementDAO().createPaiementCB(paiementCB);
		} catch (Exception e) {
			return false;
		}
	}

	public boolean updatePaiementCB(PaiementCB paiementCB) throws IPIWebException {

		try {
			return DAOFactory.getPaiementDAO().updatePaiementCB(paiementCB);
		} catch (Exception e) {
			return false;
		}

	}

	public boolean deletePaiementCB(PaiementCB paiementCB) throws IPIWebException {

		try {
			return DAOFactory.getPaiementDAO().deletePaiementCB(paiementCB);
		} catch (Exception e) {
			return false;
		}

	}

	public List<PaiementCB> getListPaiementCB() throws IPIWebException {
		try {
			return DAOFactory.getPaiementDAO().getListPaiementCB();
		} catch (Exception e) {
			return new ArrayList<PaiementCB>();
		}
	}

	public boolean createPaiementPaypal(PaiementPaypal paiementPaypal) throws IPIWebException {
		try {
			return DAOFactory.getPaiementDAO().createPaiementPaypal(paiementPaypal);
		} catch (Exception e) {
			return false;
		}
	}

	public boolean updatePaiementPaypal(PaiementPaypal paiementPaypal) throws IPIWebException {
		try {
			return DAOFactory.getPaiementDAO().createPaiementPaypal(paiementPaypal);
		} catch (Exception e) {
			return false;
		}
	}

	public boolean deletePaiementPaypal(PaiementPaypal paiementPaypal) throws IPIWebException {
		try {
			return DAOFactory.getPaiementDAO().deletePaiementPaypal(paiementPaypal);
		} catch (Exception e) {
			return false;
		}
	}

	public List<PaiementPaypal> getListPaiementPaypal() throws IPIWebException {
		try {
			return DAOFactory.getPaiementDAO().getListPaiementPaypal();
		} catch (Exception e) {
			return new ArrayList<PaiementPaypal>();
		}
	}*/

}
